/**
 * 
 */
define([], function() {
	function redirect(redirectUrl, second, tickCallback) {
		function countDown() {
			if (second <= 0) {
				window.location.href = redirectUrl;
				return;
			}
			second--;
			if (tickCallback) {
				tickCallback(second);
			}
			window.setTimeout(countDown, 1000);
		}
		window.setTimeout(countDown, 1000);
	}

	return redirect;
});